package io.renren.modules.eas.service.impl;

import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;
import io.renren.modules.eas.dao.EasBasicSchoolDao;
import io.renren.modules.eas.entity.EasBasicSchoolEntity;
import io.renren.modules.eas.service.EasBasicSchoolService;

@Service("easBasicSchoolService")
public class EasBasicSchoolServiceImpl extends ServiceImpl<EasBasicSchoolDao, EasBasicSchoolEntity>
        implements EasBasicSchoolService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        IPage<EasBasicSchoolEntity> page = this.page(
                new Query<EasBasicSchoolEntity>().getPage(params),
                new QueryWrapper<EasBasicSchoolEntity>());

        return new PageUtils(page);
    }

    @Override
    public PageUtils searchPage(Map<String, Object> params, String search) {
        IPage<EasBasicSchoolEntity> page = this.page(
                new Query<EasBasicSchoolEntity>().getPage(params),
                new QueryWrapper<EasBasicSchoolEntity>().like("name", search).ne("id", 1));

        return new PageUtils(page);
    }

}